#include "widget.h"
#include "ui_widget.h"
#include<QPushButton>
#include<QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QPushButton*button1=new QPushButton("按钮1",this);
    QPushButton*button2=new QPushButton("按钮2",this);
    resize(800,600);
    int m=10;
    button1->move(300,100);
    button2->move(100,250);
    connect(button1,&QPushButton::clicked,this,[=]()mutable{m=20;qDebug()<<m;});

    connect(button2,&QPushButton::clicked,this,[=]()mutable{m=10;qDebug()<<m;});

}

Widget::~Widget()
{
    delete ui;
}

